<template>
  <el-button type="info" :icon="icon" @click="goHome">{{ text }}</el-button>
</template>

<script setup>
import { useRouter } from "vue-router";

const props = defineProps({
  icon: {
    type: String,
    default: "HomeFilled",
  },
  text: {
    type: String,
    default: "请先登录",
  },
  path: {
    type: String,
    default: "/login",
  },
});

const router = useRouter();

const goHome = () => {
  router.push(props.path);
};
</script>
